package com.stillalive.mybatis.controller;

import com.stillalive.mybatis.model.UserInfo;
import com.stillalive.mybatis.service.UserInfoService;
import org.apache.ibatis.annotations.Insert;
import org.apache.tomcat.util.buf.UDecoder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RequestMapping("/user")
@RestController
public class UserInfoController {

    @Autowired
    UserInfoService userInfoService;
    @RequestMapping("/getUser")
    public List<UserInfo> getUser(){
        return userInfoService.getUser();
    }

    @RequestMapping("/getUserById")
    public UserInfo getUserById(Integer id){
        return userInfoService.getUserById(id);
    }


}
